Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS][non-icu] HybridGlobalization implement japanese calendar data #92471

Merged
merged 12 commits into from
Oct 9, 2023

Conversation

mkhamoyan
Copy link
Member

@mkhamoyan mkhamoyan commented Sep 22, 2023

Implement japanese calendar methods for hybrid mode on Apple platforms.

  • GetCalendars
  • GetLatestJapaneseEra
  • GetJapaneseEraStartDate

Contributes to #80689

cc @SamMonoRT

@ghost
Copy link

ghost commented Sep 22, 2023

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Issue Details

Implement below methods for hybrid mode on Apple platforms.

  • GetCalendars
  • GetLatestJapaneseEra
  • GetJapaneseEraStartDate

Contributes to #80689

cc @SamMonoRT

Author: mkhamoyan
Assignees: mkhamoyan
Labels:

area-System.Globalization

Milestone: -

@mkhamoyan mkhamoyan marked this pull request as ready for review September 22, 2023 15:54
@mkhamoyan
Copy link
Member Author

/azp run runtime-ioslike

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarekgh tarekgh added the os-ios Apple iOS label Sep 22, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

Implement japanese calendar methods for hybrid mode on Apple platforms.

  • GetCalendars
  • GetLatestJapaneseEra
  • GetJapaneseEraStartDate

Contributes to #80689

cc @SamMonoRT

Author: mkhamoyan
Assignees: mkhamoyan
Labels:

area-System.Globalization, os-ios

Milestone: -

@mkhamoyan
Copy link
Member Author

/azp run runtime-ioslike

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

NSString *defaultCalendarIdentifier = [currentLocale calendarIdentifier];
int32_t calendarCount = MIN(calendarIdentifiers.count, calendarsCapacity);
int32_t calendarIndex = 0;
calendars[calendarIndex++] = GetCalendarId([defaultCalendarIdentifier UTF8String]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theres a possibility of this being UNINITIALIZED_VALUE right? It doesn't seem like we should be setting this if its not a known calendar Id. Which highlights that there are more calendars in the calendarIdentifiers list than in the known calendarIds in GetCalendarId. Should we expand the coverage of GetCalendarId and GetCalendarIdentifier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, I will update it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the part related to UNINITIALIZED_VALUE , but for expanding coverage in GetCalendarId and GetCalendarIdentifier, looks like it is not smth that we support in C# side with current implementation. Supported calendars are implemented in C# like for example https://github.com/mkhamoyan/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Globalization/JapaneseCalendar.cs . I guess I can open a ticket to see if we can implement more calendars that are supported by NSCalendarIdentifier. What do you think?

else
{
string[]? abbrevEraNames;
if (!CalendarData.EnumCalendarInfo("ja", CalendarId.JAPAN, CalendarDataType.AbbrevEraNames, out abbrevEraNames))
Copy link
Member

@mdh1418 mdh1418 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we still use out abbrevEnglishEraNames! directly instead like in the non-apple block? So making this else block the same as the non-apple block

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it.

@mkhamoyan
Copy link
Member Author

/azp run runtime-extra-platforms

@mkhamoyan mkhamoyan requested a review from mdh1418 October 6, 2023 08:53
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Member Author

/azp run runtime-extra-platforms

@mkhamoyan mkhamoyan requested a review from mdh1418 October 9, 2023 08:07
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@mdh1418 mdh1418 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks!

@mkhamoyan
Copy link
Member Author

Failures are not related.

@mkhamoyan mkhamoyan merged commit a5461cb into dotnet:main Oct 9, 2023
228 of 248 checks passed
@mkhamoyan mkhamoyan deleted the hybrid_japanese_calendar branch October 9, 2023 13:42
@ghost ghost locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants